package com.apabi.service.impl;

import com.apabi.dao.CollectionsDao;
import com.apabi.model.Collections;
import com.apabi.service.CollectionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created by huhu on 2018/1/13.
 */
@Service
@Transactional
public class CollectionsServiceImpl implements CollectionsService{

    @Autowired
    private CollectionsDao collectionsDao;

    @Override
    public Page<Collections> findByUserId(int uid, Pageable pageable) {
        return collectionsDao.findByUserId(uid, pageable);
    }

    @Override
    public void removeByUserId(Integer id) {
        collectionsDao.removeByUserId(id);
    }

    @Override
    public void removeByIdAndUserId(Integer userId,Integer id) {
        collectionsDao.removeByIdAndUserId(userId,id);
    }


}
